<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    
    <link rel="stylesheet" type="text/css" href="../../css/bootstrap.min.css"/>
    <script type="text/javascript" src="../../js/itnetcao.js"></script>
    <script type="text/javascript" src="../../js/qrcode.min.js"></script>
    <script type="text/javascript" src="../../js/jquery-2.2.3.min.js"></script>
    <link href="../../js/layui/css/layui.css" rel="stylesheet" />
    
    
    
    
    
    
		<title>detail</title>
		<style type="text/css">
			*{
				margin: 0;padding: 0;
			}
	      body{
	        font-family:"微软雅黑";
	      }
			.body{
				width: 100%;
				height: 15rem;
			}
			.head{
				font-size: 0.5rem;
				width: 100%;
				height:6rem;
				line-height: 2.2rem;
				background-color: #FFB800;
			}
			a{
				text-decoration: none;
				color: black;
				margin-left: 0.2rem;
			}
			.head p:nth-child(1){
				position: relative;
				left: 3.5rem;
			}
			.head p:nth-child(2){
				position: relative;
				left: 4.2rem;
				top: 1.5rem;
				font-size: 0.4rem;
			}
			.head span{
			    position: relative;
				left: -3.5rem;
				top: 0.1rem;
				color: black;
			}

			.one{
				width: 100%;
				height: 2rem;
				border-bottom: 1px solid #CCCCCC;
				line-height: 2rem;
				color: #999999;
				text-indent: 0.8rem;
			}
			.one span{
				color: black;
				margin-left: 0.2rem;
			}
		</style>
		
	</head>
	<body style='overflow:hidden;height:100%;'>
		<div style='height:100%;'>
			<div class="body" style='overflow:hidden;'>
				<div class="head">
					<p><a href="javascript:history.go(-1)"><span class="glyphicon glyphicon-menu-left"></a></span>
						社区详情
					</p>
	
			</div>
			
			<div class="one">
				<p>社区管理员：<span class='userName'></span></p>
			</div>
			<div class="one">
				<p>社区宣言：&nbsp;&nbsp;&nbsp;&nbsp;<span class='coContext'></span></p>
			</div>
			<div align="center">
				<div align="center" style='font-size:16px;margin-bottom:5px;'>
					社区二维码
				</div>
				<span id="shequQrCode" style='height:200px;'>
					
				</span>
			</div>
		</div>
		<a class="layui-btn layui-btn-warm create" style='display:none;width:100%;z-index:100000000;'>创建</a>
	</body>
<script>
var qrcode = new QRCode(document.getElementById("shequQrCode"), {
render:'canvas||table',
	width : 150,
	height : 150
});

function makeCode (code) {
	qrcode.makeCode(code);
}
$(function() {
	$(".create").click(function() {
		window.location.href = 'userCreateCommunity.html';
	})
	var userId = jQuery.parseJSON(localStorage.getItem("miningmachine_user")).userId;
	var url = localStorage.getItem("url") + "/user/controller/UserFindUserIdCreateCommunityAPP.do";
	var data = "userId=" + userId;
	itcao.itGetAjaxBigData(url, data).done(function(result) {
		var json = jQuery.parseJSON(result);
		if(json.state == true) {
			$(".userName").text(json.bean.userName);
			$(".coContext").text(json.bean.coContext);
			makeCode(json.bean.coQrCode);
			$(".create").hide();
		}else {
			
			// 根据自己的社团找社团信息
			
			url = localStorage.getItem("url") + "/user/controller/UserFindCommunityDescAPP.do";
			
			itcao.itGetAjaxBigData(url, data).done(function(result) {
				var json = jQuery.parseJSON(result);
				if(json.state == true) {
					$(".userName").text(json.bean.userName);
					$(".coContext").text(json.bean.coContext);
					makeCode(json.bean.coQrCode);
					$(".create").hide();
				}else {
					$(".create").show();
				}
			})
		}
	})
})
</script>
<script>
(function() {
	var supportsOrientationChange = 'onorientationchange' in window ? 'orientationchange' : 'resize';
	var timeoutId;
	function setRem() {
		var clientWidth = document.documentElement.clientWidth;
		var nowPX = clientWidth / 1024 * 100;
		document.documentElement.style.fontSize = nowPX + 'px';
	}
	setRem();
	window.addEventListener(supportsOrientationChange, function() {
		clearTimeout(timeoutId);
		timeoutId = setTimeout(function() {
			setRem();
		}, 300);
	}, false);
})();
</script>
</html>
